package Day01_Reflect;

import TestClass.Person;

public class Demo01_Reflect {
    public static void main(String[] args) throws ClassNotFoundException {
        //1.Class.forName("全类名")
        Class cls1 = Class.forName("TestClass.Person");
        System.out.println(cls1);
        //2.类名.class
        Class cls2 = Person.class;
        System.out.println(cls2);
        //3.对象.getClass()
        Person p = new Person();
        Class cls3 = p.getClass();
        System.out.println(cls3);
        //4.比较
        System.out.println(cls1 == cls2);
        System.out.println(cls1 == cls3);
    }
}
